<html>
<head>
  <meta HTTP-EQUIV="Content-Type" CONTENT="text/html;charset=ISO-8859-1">
  <title>Contents.m</title>
<link rel="stylesheet" type="text/css" href="../stpr.css">
</head>
<body>
<table  border=0 width="100%" cellpadding=0 cellspacing=0><tr valign="baseline">
<td valign="baseline" class="function"><b class="function">ADACLASS</b>
<td valign="baseline" align="right" class="function"><a href="../misc/index.html" target="mdsdir"><img border = 0 src="../up.gif"></a></table>
  <p><b>AdaBoost classifier.</b></p>
  <hr>
<div class='code'><code>
<span class=help></span><br>
<span class=help>&nbsp;<span class=help_field>Synopsis:</span></span><br>
<span class=help>&nbsp;&nbsp;[y,dfce]&nbsp;=&nbsp;adaclass(X,model)</span><br>
<span class=help></span><br>
<span class=help>&nbsp;<span class=help_field>Description:</span></span><br>
<span class=help>&nbsp;&nbsp;This&nbsp;function&nbsp;implements&nbsp;the&nbsp;AdaBoost&nbsp;classifier&nbsp;which</span><br>
<span class=help>&nbsp;&nbsp;its&nbsp;discriminant&nbsp;function&nbsp;is&nbsp;composed&nbsp;of&nbsp;a&nbsp;weighted&nbsp;sum</span><br>
<span class=help>&nbsp;&nbsp;of&nbsp;binary&nbsp;rules.&nbsp;It&nbsp;is&nbsp;assumed&nbsp;here&nbsp;that&nbsp;the&nbsp;binary&nbsp;rules</span><br>
<span class=help>&nbsp;&nbsp;respond&nbsp;with&nbsp;label&nbsp;1&nbsp;or&nbsp;2&nbsp;(not&nbsp;1&nbsp;and&nbsp;-1&nbsp;as&nbsp;used&nbsp;in&nbsp;</span><br>
<span class=help>&nbsp;&nbsp;AdaBoost&nbsp;literature).</span><br>
<span class=help></span><br>
<span class=help>&nbsp;<span class=help_field>Input:</span></span><br>
<span class=help>&nbsp;&nbsp;X&nbsp;[dim&nbsp;x&nbsp;num_data]&nbsp;Vectors&nbsp;to&nbsp;be&nbsp;classified.</span><br>
<span class=help>&nbsp;&nbsp;model&nbsp;[struct]&nbsp;AdaBoost&nbsp;classifier:</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;.rule&nbsp;[cell&nbsp;1&nbsp;x&nbsp;T]&nbsp;Binary&nbsp;weak&nbsp;rules.</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;.Alpha&nbsp;[1&nbsp;x&nbsp;T]&nbsp;Weights&nbsp;of&nbsp;the&nbsp;weak&nbsp;rules.</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;.fun&nbsp;=&nbsp;'adaclass'&nbsp;(optinal).</span><br>
<span class=help></span><br>
<span class=help>&nbsp;<span class=help_field>Output:</span></span><br>
<span class=help>&nbsp;&nbsp;y&nbsp;[1&nbsp;x&nbsp;num_data]&nbsp;Predicted&nbsp;labels.</span><br>
<span class=help>&nbsp;&nbsp;dfce&nbsp;[1&nbsp;x&nbsp;num_data]&nbsp;Values&nbsp;of&nbsp;weighted&nbsp;sum&nbsp;of&nbsp;</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;weak&nbsp;rules;&nbsp;y(i)&nbsp;=&nbsp;1&nbsp;if&nbsp;dfce(i)&nbsp;&gt;=&nbsp;0&nbsp;and</span><br>
<span class=help>&nbsp;&nbsp;&nbsp;y(i)&nbsp;=&nbsp;2&nbsp;if&nbsp;dfce(i)&nbsp;&lt;&nbsp;0.</span><br>
<span class=help></span><br>
<span class=help>&nbsp;<span class=help_field>Example:</span></span><br>
<span class=help>&nbsp;&nbsp;trn_data&nbsp;=&nbsp;load('riply_trn');</span><br>
<span class=help>&nbsp;&nbsp;tst_data&nbsp;=&nbsp;load('riply_tst');</span><br>
<span class=help>&nbsp;&nbsp;options.learner&nbsp;=&nbsp;'weaklearner';</span><br>
<span class=help>&nbsp;&nbsp;options.max_rules&nbsp;=&nbsp;50;</span><br>
<span class=help>&nbsp;&nbsp;options.verb&nbsp;=&nbsp;1;</span><br>
<span class=help>&nbsp;&nbsp;model&nbsp;=&nbsp;adaboost(trn_data,&nbsp;options);</span><br>
<span class=help>&nbsp;&nbsp;ypred1&nbsp;=&nbsp;adaclass(trn_data.X,model);</span><br>
<span class=help>&nbsp;&nbsp;ypred2&nbsp;=&nbsp;adaclass(tst_data.X,model);</span><br>
<span class=help>&nbsp;&nbsp;trn_err&nbsp;=&nbsp;cerror(ypred1,trn_data.y)</span><br>
<span class=help>&nbsp;&nbsp;tst_err&nbsp;=&nbsp;cerror(ypred2,tst_data.y)</span><br>
<span class=help></span><br>
<span class=help>&nbsp;See&nbsp;also:&nbsp;</span><br>
<span class=help>&nbsp;&nbsp;ADABOOST,&nbsp;WEAKLEARNER.</span><br>
<span class=help></span><br>
</code></div>
  <hr>
  <b>Source:</b> <a href= "../misc/list/adaclass.html">adaclass.m</a>
  <p><b class="info_field">About: </b>  Statistical Pattern Recognition Toolbox<br>
 (C) 1999-2004, Written by Vojtech Franc and Vaclav Hlavac<br>
 <a href="http://www.cvut.cz">Czech Technical University Prague</a><br>
 <a href="http://www.feld.cvut.cz">Faculty of Electrical Engineering</a><br>
 <a href="http://cmp.felk.cvut.cz">Center for Machine Perception</a><br>

  <p><b class="info_field">Modifications: </b> <br>
 25-aug-2004, VF<br>
 11-aug-2004, VF<br>

</body>
</html>
